Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Cookbook / Part - Appendixes
Appendix B - System Object Model


Development Process

To have the advantages of SOM, you must define objects with well-defined interfaces separated from their implementations. The SOM compiler enables you to do this. At runtime, the SOM kernel supports execution of such objects.

You define the interface to a SOM object in the SOM Interface Definition Language described in the next section. However, you implement the methods of a SOM object and write client programs of the object in a full-featured programming language such as C++, the language used for SamplePart part editor.

After you define a SOM class in IDL, you run the SOM compiler on the IDL file. The SOM compiler produces three files in a target language, for which the SOM compiler must have a language-specific emitter. SamplePart uses the C++ emitter. The compiler output files are a usage binding, an implementation binding, and an implementation template file. The usage binding file (extension .xh) is similar to a regular C++ header file; client programs that use the SOM class include the usage binding file. The implementation binding file (extension .xih) is private to the SOM class and included in the class implementation; it contains macro definitions enabling the class implementation to have access to its instance variable and to call superclass methods. The implementation template file (extension .cpp) is similar to a regular C++ implementation file; as emitted by the SOM compiler, it contains stub function definitions for each method declared in the IDL file. Writing in C++, you must fill in the function bodies for each new and overridden method in the class.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
16 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help